/*
Date:20210517 9:21AM
key:最大深度，空节点为0，递归时挑选max+1即可
同：https://leetcode-cn.com/problems/maximum-depth-of-binary-tree/submissions/
 */
class Solution {
public:

    int maxDepth(TreeNode* root) 
    {
        if(root==nullptr){return 0;}
        else
        {
            return max(maxDepth(root->left),maxDepth(root->right))+1;
        }
    }
};